package com.wicket.okrapp.integration.dto;

import com.wicket.okrapp.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Objects;
import javax.validation.constraints.NotNull;
import lombok.Data;

/**
 * @desc TargetBudgetSetDto
 * @使用场景
 */
@Data
public class TargetBudgetSetDto extends BaseDto implements Serializable {

  /**
   * 目标预算设置ID
   */
  @NotNull(message = "目标预算设置ID不能为空")
  @ApiModelProperty("目标预算设置ID")
  private String targetCostSetId;

  /**
   * 周期预算金额
   */
  @NotNull(message = "周期预算金额不能为空")
  @ApiModelProperty("周期预算金额")
  private Double cycleBudgetAmount;

  /**
   * 被评对象目标周期ID
   */
  @NotNull(message = "被评对象目标周期ID不能为空")
  @ApiModelProperty("被评对象目标周期ID")
  private String evaObjTargetCycleId;

  /**
   * 资金来源ID
   */
  @NotNull(message = "资金来源ID不能为空")
  @ApiModelProperty("资金来源ID")
  private String capitalSourceId;

  /**
   * 冗余预算单位
   */
  @ApiModelProperty("冗余预算单位")
  private String cycleBudgetUnit;

  /**
   * 预算金额占比
   */
  @ApiModelProperty("预算金额占比")
  private Double budgetRate;

  /**
   * 资金来源名称
   */
  @ApiModelProperty("资金来源名称")
  private String capitalSourceName;

  /**
   * 周期名称
   */
  @ApiModelProperty("周期名称")
  private String cycleStandardName;

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;
    TargetBudgetSetDto that = (TargetBudgetSetDto) o;
    return (
      targetCostSetId == that.targetCostSetId &&
      cycleBudgetAmount == that.cycleBudgetAmount &&
      evaObjTargetCycleId == that.evaObjTargetCycleId &&
      capitalSourceId == that.capitalSourceId &&
      cycleBudgetUnit == that.cycleBudgetUnit &&
      budgetRate == that.budgetRate &&
      capitalSourceName == that.capitalSourceName &&
      cycleStandardName == that.cycleStandardName
    );
  }

  @Override
  public int hashCode() {
    return Objects.hash(
      super.hashCode(),
      targetCostSetId,
      cycleBudgetAmount,
      evaObjTargetCycleId,
      capitalSourceId,
      cycleBudgetUnit,
      budgetRate,
      capitalSourceName,
      cycleStandardName
    );
  }

}
